<div class="data-div" xmlns:th="http://www.w3.org/1999/xhtml">
    <div class="widget-header bordered-bottom bordered-themeprimary">
        <i class="widget-icon fa fa-tasks themeprimary"></i>
        <span class="widget-caption themeprimary">数据列表</span>
        <form  role="form" onsubmit="return false;" id="form_data_table_par_pay_channel_list_1">
            <input  type="hidden" value="" name="logType" th:value="1"/>
            <div class="widget-buttons">
                <input  type="hidden" value="" name="merchantId" th:value="${merchantId}"/>
                开通状态：<select name="opened" id="opened"  style="width:160px;margin-right:10px;padding: 3px;" >
                            <option value="">--全部--</option>
                            <option value="-1">--审核失败--</option>
                            <option value="0">--未申请--</option>
                            <option value="1">--已开通--</option>
                            <option value="2">--审核中--</option>
                         </select>
                启用状态：<select name="isUsing" id="isUsing"  style="width:160px;margin-right:10px;padding: 3px;" >
                            <option value="">--全部--</option>
                            <option value="0">--未启用--</option>
                            <option value="1">--已启用--</option>
                         </select>
                支付通道名：<input type="text" name="typeTips" style="width:120px;height:25px;margin-right:10px;padding: 3px;">
            </div>
            <div class="widget-buttons">
                <button href="javascript:;" class="btn btn-blue btn-xs search"  data-title="查询" data-form="true" onclick="">查询</button>
            </div>

        </form>
    </div>

    <div class="widget no-header ">
        <div class="widget-body">
            <table class="table table-condensed table-bordered table-hover " id="data_table_par_pay_channel_list_1">
            </table>

        </div>
    </div>
    <!-- END SAMPLE TABLE PORTLET-->
</div>

<script type="text/javascript">

    $(document).ready(function() {

        //look-up 查询条件 会员
        Select2Ex.handleForm4select2({target:$("#form_data_table_par_pay_channel_list_1")});

        TableAjax.init('data_table_par_pay_channel_list_1',{
            sAjaxSource: "merchant/pay/channel/par_list",
            aaSorting: [ [0, "asc" ] ], // 需要自定义
            uxDataTitle:"null",
            uxCheckable:false,
            uxCloseScroll:true,
            uxDrapable:false,
            aoColumns: [
                {sTitle:'序号',  mData: "id",uxLongText:true},
                {sTitle:'支付渠道',  mData: "typeTips",uxLongText:true},
                {sTitle:'功能状态',  mData: "isUsing",
                    mRender:function(data,d,all){
                        if (all.isUsing==0){
                            return "<font color='red'>未启用</font>";
                        }else if (all.isUsing==1){
                            return "<font color='green'>已启用</font>";
                        }
                        return "未知";
                    }
                },
                {sTitle:'签约状态',  mData: "opened",
                    mRender:function(data,d,all){
                        if (all.opened==0){
                            return "<font color='red'>未申请</font>";
                        }else if (all.opened==1){
                            return "<font color='green'>已开通</font>";
                        }else if (all.opened==-1){
                            return "<font color='red'>审核失败</font>";
                        }else if (all.opened==2){
                            return "<font color='#483d8b'>审核中</font>";
                        }
                        return "未知";
                    }
                },
                {sTitle:'操作',
                    mData: "id" ,
                    mRender:function(data,d,all){
                        var html = "";
                        if (all.opened==0){
                            html += '<a class="blue-stripes" style="margin:15px" data-title="申请开通" data-handler="INLINE" href="merchant/pay/channel/apply_open_page?payChannelId='+all.id+'" modal-size="99%">申请开通</a>';
                        }else if(all.opened==-1||all.opened==2){
                            html += '<a class="blue-stripes" style="margin:15px" data-title="重新申请" data-handler="INLINE" href="merchant/pay/channel/apply_open_page?payChannelId='+all.id+'" modal-size="99%">重新申请</a>';
                        }
                        return html;
                    }
                }
            ]

        });

    });

</script>